import { request } from '@boeyo/portal';

/**
 * 获取ViewToken
 */
export const getViewToken = (data?) => {
  return request({
    url: '/bimface/getViewToken',
    method: 'POST',
    data,
    skipError: true,
  });
};

/**
 * 设备列表
 */
export const bindList = (params?) => {
  return request({
    url: '/bim/bindList',
    method: 'get',
    params,
  });
};
/**
 * 绑定
 */
export const bindPoint = (data) => {
  return request({
    url: '/bim/bind',
    method: 'post',
    data,
  });
};
/**
 * 场景预览
 */
export const preview = (id) => {
  return request({
    url: `scene2d/preview/${id}`,
  });
};

/**
 * 解绑
 */
export const unbindPoint = (bindId) => {
  return request({
    url: `/bim/${bindId}`,
    method: 'post',
  });
};
